import os
import sys
import time
import random
import uuid
from string import Template

def get_current_highest():
    """获取当前时间戳"""
    return int(time.time())


def sum_data(a, b):
    """计算函数"""
    return a + b


def set_token(token: str):
    """设置token，直接返回字典"""
    return {"Authorization": token}


def skip():
    return True


def skip_if(user_id):
    if user_id > 300:
        return True
    else:
        return False


def sql():
    return "select * from sp_goods;"

def rand(max, min: int=0):
    s = random.randint(min,max)
    # print(s)
    return s


def get_uuid():
    id = uuid.uuid1()
    # id_str=str(id)
    # print(id_str)
    return str(id)

def get_dict(replace_str):
    # uid = get_uuid()
    s2 = '[{\"id\":\"$uuid\",\"parentId\":\"0\",\"label\":\"A\",\"value\":\"$uuid1\",\"children\":""}]'
    s1 = Template(s2)
    s3 =s1.substitute({'uuid': replace_str,'uuid1':replace_str})
    # print(s3)
    return s3

if __name__ == "__main__":
    get_dict()
    # print("a" in ["123","a"])
    # print(sys.platform)
    # print(os.system("uname -r"))
    # import platform
    # print(platform.mac_ver())
    # print(platform.uname())
    # print(platform.python_version())
    # print(os.getlogin())
    # import getpass
    # print(getpass.getuser())